package com.example.lib5;

import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.temporal.Temporal;
import java.util.Arrays;
import java.util.Date;

public class MyClass {
    public static void main(String[] args) {
        /*int i = 0x3 << 30;//11000000000000000000000000000000
        int i2 = 1 << 3;//1,1000,2*2*2
        System.out.println(i);
        System.out.println(i2);
        int i1 = ~i;
        System.out.println(i1);*/
        //测试比较与直接返回的速度
                Date date = new Date();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time1 = simpleDateFormat.format(date);
        System.out.println("排序前时间："+time1);

        for (int i = 0; i < 10000000; i++) {
            int value = getValue(2);
        }

        Date date2 = new Date();
        String time2 = simpleDateFormat.format(date2);
        System.out.println("排序后时间："+time2);

    }

    private static int getValue(int i) {
        int a=2;
        if (a==2){
            return 2;
        }
        return 1;
    }
}
